{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport { render as reactRender, unmount as reactUnmount } from \"rc-util/es/React/render\";\nimport * as React from 'react';\nimport { globalConfig } from '../config-provider';\nimport warning from '../_util/warning';\nimport ConfirmDialog from './ConfirmDialog';\nimport destroyFns from './destroyFns';\nimport { getConfirmLocale } from './locale';\nlet defaultRootPrefixCls = '';\nfunction getRootPrefixCls() {\n  return defaultRootPrefixCls;\n}\nexport default function confirm(config) {\n  const container = document.createDocumentFragment();\n  // eslint-disable-next-line @typescript-eslint/no-use-before-define\n  let currentConfig = Object.assign(Object.assign({}, config), {\n    close,\n    open: true\n  });\n  let timeoutId;\n  function destroy() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    const triggerCancel = args.some(param => param && param.triggerCancel);\n    if (config.onCancel && triggerCancel) {\n      config.onCancel.apply(config, [() => {}].concat(_toConsumableArray(args.slice(1))));\n    }\n    for (let i = 0; i < destroyFns.length; i++) {\n      const fn = destroyFns[i];\n      // eslint-disable-next-line @typescript-eslint/no-use-before-define\n      if (fn === close) {\n        destroyFns.splice(i, 1);\n        break;\n      }\n    }\n    reactUnmount(container);\n  }\n  function render(_a) {\n    var {\n        okText,\n        cancelText,\n        prefixCls: customizePrefixCls\n      } = _a,\n      props = __rest(_a, [\"okText\", \"cancelText\", \"prefixCls\"]);\n    clearTimeout(timeoutId);\n    /**\n     * https://github.com/ant-design/ant-design/issues/23623\n     *\n     * Sync render blocks React event. Let's make this async.\n     */\n    timeoutId = setTimeout(() => {\n      const runtimeLocale = getConfirmLocale();\n      const {\n        getPrefixCls,\n        getIconPrefixCls\n      } = globalConfig();\n      // because Modal.config \b set rootPrefixCls, which is different from other components\n      const rootPrefixCls = getPrefixCls(undefined, getRootPrefixCls());\n      const prefixCls = customizePrefixCls || `${rootPrefixCls}-modal`;\n      const iconPrefixCls = getIconPrefixCls();\n      reactRender( /*#__PURE__*/React.createElement(ConfirmDialog, Object.assign({}, props, {\n        prefixCls: prefixCls,\n        rootPrefixCls: rootPrefixCls,\n        iconPrefixCls: iconPrefixCls,\n        okText: okText,\n        locale: runtimeLocale,\n        cancelText: cancelText || runtimeLocale.cancelText\n      })), container);\n    });\n  }\n  function close() {\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n    currentConfig = Object.assign(Object.assign({}, currentConfig), {\n      open: false,\n      afterClose: () => {\n        if (typeof config.afterClose === 'function') {\n          config.afterClose();\n        }\n        destroy.apply(this, args);\n      }\n    });\n    // Legacy support\n    if (currentConfig.visible) {\n      delete currentConfig.visible;\n    }\n    render(currentConfig);\n  }\n  function update(configUpdate) {\n    if (typeof configUpdate === 'function') {\n      currentConfig = configUpdate(currentConfig);\n    } else {\n      currentConfig = Object.assign(Object.assign({}, currentConfig), configUpdate);\n    }\n    render(currentConfig);\n  }\n  render(currentConfig);\n  destroyFns.push(close);\n  return {\n    destroy: close,\n    update\n  };\n}\nexport function withWarn(props) {\n  return Object.assign(Object.assign({}, props), {\n    type: 'warning'\n  });\n}\nexport function withInfo(props) {\n  return Object.assign(Object.assign({}, props), {\n    type: 'info'\n  });\n}\nexport function withSuccess(props) {\n  return Object.assign(Object.assign({}, props), {\n    type: 'success'\n  });\n}\nexport function withError(props) {\n  return Object.assign(Object.assign({}, props), {\n    type: 'error'\n  });\n}\nexport function withConfirm(props) {\n  return Object.assign(Object.assign({}, props), {\n    type: 'confirm'\n  });\n}\nexport function modalGlobalConfig(_ref) {\n  let {\n    rootPrefixCls\n  } = _ref;\n  process.env.NODE_ENV !== \"production\" ? warning(false, 'Modal', 'Modal.config is deprecated. Please use ConfigProvider.config instead.') : void 0;\n  defaultRootPrefixCls = rootPrefixCls;\n}","map":{"version":3,"names":["_toConsumableArray","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","render","reactRender","unmount","reactUnmount","React","globalConfig","warning","ConfirmDialog","destroyFns","getConfirmLocale","defaultRootPrefixCls","getRootPrefixCls","confirm","config","container","document","createDocumentFragment","currentConfig","assign","close","open","timeoutId","destroy","_len","arguments","args","Array","_key","triggerCancel","some","param","onCancel","apply","concat","slice","fn","splice","_a","okText","cancelText","prefixCls","customizePrefixCls","props","clearTimeout","setTimeout","runtimeLocale","getPrefixCls","getIconPrefixCls","rootPrefixCls","undefined","iconPrefixCls","createElement","locale","_len2","_key2","afterClose","visible","update","configUpdate","push","withWarn","type","withInfo","withSuccess","withError","withConfirm","modalGlobalConfig","_ref","process","env","NODE_ENV"],"sources":["/data/messenger.client/node_modules/antd/es/modal/confirm.js"],"sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport { render as reactRender, unmount as reactUnmount } from \"rc-util/es/React/render\";\nimport * as React from 'react';\nimport { globalConfig } from '../config-provider';\nimport warning from '../_util/warning';\nimport ConfirmDialog from './ConfirmDialog';\nimport destroyFns from './destroyFns';\nimport { getConfirmLocale } from './locale';\nlet defaultRootPrefixCls = '';\nfunction getRootPrefixCls() {\n  return defaultRootPrefixCls;\n}\nexport default function confirm(config) {\n  const container = document.createDocumentFragment();\n  // eslint-disable-next-line @typescript-eslint/no-use-before-define\n  let currentConfig = Object.assign(Object.assign({}, config), {\n    close,\n    open: true\n  });\n  let timeoutId;\n  function destroy() {\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    const triggerCancel = args.some(param => param && param.triggerCancel);\n    if (config.onCancel && triggerCancel) {\n      config.onCancel.apply(config, [() => {}].concat(_toConsumableArray(args.slice(1))));\n    }\n    for (let i = 0; i < destroyFns.length; i++) {\n      const fn = destroyFns[i];\n      // eslint-disable-next-line @typescript-eslint/no-use-before-define\n      if (fn === close) {\n        destroyFns.splice(i, 1);\n        break;\n      }\n    }\n    reactUnmount(container);\n  }\n  function render(_a) {\n    var {\n        okText,\n        cancelText,\n        prefixCls: customizePrefixCls\n      } = _a,\n      props = __rest(_a, [\"okText\", \"cancelText\", \"prefixCls\"]);\n    clearTimeout(timeoutId);\n    /**\n     * https://github.com/ant-design/ant-design/issues/23623\n     *\n     * Sync render blocks React event. Let's make this async.\n     */\n    timeoutId = setTimeout(() => {\n      const runtimeLocale = getConfirmLocale();\n      const {\n        getPrefixCls,\n        getIconPrefixCls\n      } = globalConfig();\n      // because Modal.config \b set rootPrefixCls, which is different from other components\n      const rootPrefixCls = getPrefixCls(undefined, getRootPrefixCls());\n      const prefixCls = customizePrefixCls || `${rootPrefixCls}-modal`;\n      const iconPrefixCls = getIconPrefixCls();\n      reactRender( /*#__PURE__*/React.createElement(ConfirmDialog, Object.assign({}, props, {\n        prefixCls: prefixCls,\n        rootPrefixCls: rootPrefixCls,\n        iconPrefixCls: iconPrefixCls,\n        okText: okText,\n        locale: runtimeLocale,\n        cancelText: cancelText || runtimeLocale.cancelText\n      })), container);\n    });\n  }\n  function close() {\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n    currentConfig = Object.assign(Object.assign({}, currentConfig), {\n      open: false,\n      afterClose: () => {\n        if (typeof config.afterClose === 'function') {\n          config.afterClose();\n        }\n        destroy.apply(this, args);\n      }\n    });\n    // Legacy support\n    if (currentConfig.visible) {\n      delete currentConfig.visible;\n    }\n    render(currentConfig);\n  }\n  function update(configUpdate) {\n    if (typeof configUpdate === 'function') {\n      currentConfig = configUpdate(currentConfig);\n    } else {\n      currentConfig = Object.assign(Object.assign({}, currentConfig), configUpdate);\n    }\n    render(currentConfig);\n  }\n  render(currentConfig);\n  destroyFns.push(close);\n  return {\n    destroy: close,\n    update\n  };\n}\nexport function withWarn(props) {\n  return Object.assign(Object.assign({}, props), {\n    type: 'warning'\n  });\n}\nexport function withInfo(props) {\n  return Object.assign(Object.assign({}, props), {\n    type: 'info'\n  });\n}\nexport function withSuccess(props) {\n  return Object.assign(Object.assign({}, props), {\n    type: 'success'\n  });\n}\nexport function withError(props) {\n  return Object.assign(Object.assign({}, props), {\n    type: 'error'\n  });\n}\nexport function withConfirm(props) {\n  return Object.assign(Object.assign({}, props), {\n    type: 'confirm'\n  });\n}\nexport function modalGlobalConfig(_ref) {\n  let {\n    rootPrefixCls\n  } = _ref;\n  process.env.NODE_ENV !== \"production\" ? warning(false, 'Modal', 'Modal.config is deprecated. Please use ConfigProvider.config instead.') : void 0;\n  defaultRootPrefixCls = rootPrefixCls;\n}"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,8CAA8C;AAC7E,IAAIC,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,C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